﻿using Newtonsoft.Json;

namespace Wechatbot.Model
{
    public class ChatCompletionRequest
    {
        [JsonProperty("app_code")]
        public string AppCode { get; set; } = "FyubB80p";

        [JsonProperty("messages")]
        public List<Message> Messages { get; set; }

        [JsonProperty("model")]
        public string? Model { get; set; }

        [JsonProperty("temperature")]
        public float Temperature { get; set; } = 0.5f;

        [JsonProperty("top_p")]
        public int TopP { get; set; } = 1;

        [JsonProperty("frequency_penalty")]
        public float FrequencyPenalty { get; set; }

        [JsonProperty("presence_penalty")]
        public float PresencePenalty { get; set; }

        [JsonProperty("stream")]
        public bool Stream { get; set; } = false;
    }

    public class Message
    {
        [JsonProperty("role")]
        public string Role { get; set; } = "user";

        [JsonProperty("content")]
        public string Content { get; set; }
    }

    public class LinkAiResponse
    {
        [JsonProperty("choices")]
        public List<LinkAiChoice> Choices { get; set; }
    }

    public class LinkAiChoice
    {
        [JsonProperty("index")]
        public int Index { get; set; }

        [JsonProperty("message")]
        public LinkAiMessage Message { get; set; }
    }

    public class LinkAiMessage
    {
        [JsonProperty("role")]
        public string Role { get; set; }

        [JsonProperty("content")]
        public string Content { get; set; }
    }
}
